<form id="passwordeditfm" method="post" style="padding: 0 8px 0 0;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="10%">用户名：</td>
            <td width="90%"><input name="username" type="text" value="<?php echo $username;?>" style="width:400px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入用户名.." required="true"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">原密码：</td>
            <td>
                <input name="oldpassword" type="password" value="" style="width:200px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入原密码.." required="true">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">新密码：</td>
            <td>
                <input name="newpassword" type="password" value="" style="width:200px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入新密码.." required="true">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">重复密码：</td>
            <td>
                <input name="repassword" type="password" value="" style="width:200px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入重复密码.." required="true">
            </td>
        </tr>
        <tr>
            <td colspan="2" bgcolor="#F4F4F4" style="border-top:#ddd 1px solid;text-align:right;text-indent: 0;padding-left: 0;">
                <div class="dialog-button">
                    <a href="javascript:;" class="l-btn l-btn-small" onclick="passwordupdatesubmit()"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">保存</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>
                    <a href="javascript:;" class="l-btn l-btn-small" onclick="passwordupdateclearForm()"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">关闭</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>
                </div>
            </td>
        </tr>
    </table>
</form>

<script>
    var passwordupdateclearForm = function () {
        $('#passwordeditfm').form('clear');
        $('#rightTabs').tabs('close', '修改密码');
    };
    var passwordupdatesubmit = function () {
        $('#passwordeditfm').form('submit', {
            url: '/admin/index/changepwd',
            success: function (data) {
                var data = eval('(' + data + ')');

                if (data.ret == 0) {
                    $.messager.show({
                        title: '提示',
                        msg: data.msg,
                        timeout: 3000,
                        showType: 'slide'
                    });
                } else {
                    $.messager.alert('提示', data.msg, 'warning');
                }
            }
        });
    };
</script>
